#ifndef __BSP_UART_H
#define __BSP_UART_H

#include "ch32f10x.h"
#include "stdio.h"	

#define dma_size 255
extern uint8_t dma_tx_buf[dma_size];
extern uint8_t dma_rx_buf[dma_size];




void USART1_Init(void);
void USART2_Init(void);
void USART3_Init(void);



void USART1_SendStr_dma(char *str);
int8_t USART1_SendBuf_dma(uint8_t *buf,uint16_t len);
void DMA1_Channel4_IRQHandler();


void USART_SendByte(USART_TypeDef* USARTx, uint8_t Data);
void USART_SendStr(USART_TypeDef* USARTx, char *STR);

void USART1_SendByte(uint8_t Data);
void USART1_SendBuf(uint8_t *buf,int len);
void USART2_SendByte(uint8_t Data);
void USART2_SendBuf(uint8_t *buf,int len);
void USART3_SendByte(uint8_t Data);
void USART3_SendBuf(uint8_t *buf,int len);


void USART2_SendStr_dma(char *str);
void USART2_SendBuf_dma(uint8_t *buf,uint16_t len);



#endif
